package org.amse.korovkin.ciphering.view;

import javax.swing.*;
import org.amse.korovkin.ciphering.view.CipherActions.*;
import org.amse.korovkin.ciphering.view.MainJFrameActions.*;
import org.amse.korovkin.ciphering.view.MyJMenuBar.*;

public class MyJToolBar extends JToolBar{
    private CipheringJFrame parent;
    private JButton open = new JButton("Open");
    private JButton encrypt = new JButton("Encrypt");
    private JButton decrypt = new JButton("Decrypt");
    private JButton attack = new JButton("Attack");
    private JButton exchange = new JButton("Exchange");
    private JButton clearSrc = new JButton("ClearSRC");
    private JButton clearDst = new JButton("ClearDST");
    public MyJToolBar(CipheringJFrame jFrame) {
        parent = jFrame;
        this.add(Box.createHorizontalGlue());
        this.add(clearSrc);
        this.add(open);
        this.add(encrypt);
        this.add(decrypt);
        this.add(attack);
        this.add(Box.createHorizontalGlue());
        this.add(Box.createHorizontalStrut(open.getPreferredSize().width * 4));
        this.add(exchange);
        this.add(clearDst);
        this.add(Box.createHorizontalStrut(open.getPreferredSize().width * 1 + 10));
        this.add(Box.createHorizontalGlue());
        open.setAction(new OpenSrcAction(parent));
        encrypt.setAction(new EncryptAction(parent));
        decrypt.setAction(new DecryptAction(parent));
        attack.setAction(new AttackAction(parent));
        exchange.setAction(new ExchangeAction(parent));
        clearSrc.setAction(new ClearSrcAction(parent));
        clearDst.setAction(new ClearDstAction(parent));
        decrypt.setText(null);
        encrypt.setText(null);
        attack.setText(null);
        clearSrc.setText(null);
        clearDst.setText(null);
        open.setText(null);
        exchange.setText(null);
        this.setFloatable(false);
        this.setRollover(true);
    }

}
